package com.igoal.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "image")
public class Image implements java.io.Serializable {

	private static final long serialVersionUID = 7942062500177574632L;

	private int id;
	private String imageUrl;
	private Date cdate;
	private Date udate;
	private Set<UserStatus> userStatuses = new HashSet<UserStatus>(0);

	public Image() {
	}

	public Image(int id) {
		this.id = id;
	}

	public Image(int id, String imageUrl, Date cdate, Date udate,
			Set<UserStatus> userStatuses) {
		this.id = id;
		this.imageUrl = imageUrl;
		this.cdate = cdate;
		this.udate = udate;
		this.userStatuses = userStatuses;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "image_url")
	public String getImageUrl() {
		return this.imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "cdate", length = 19)
	public Date getCdate() {
		return this.cdate;
	}

	public void setCdate(Date cdate) {
		this.cdate = cdate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "udate", length = 19)
	public Date getUdate() {
		return this.udate;
	}

	public void setUdate(Date udate) {
		this.udate = udate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "smiley")
	public Set<UserStatus> getUserStatuses() {
		return this.userStatuses;
	}

	public void setUserStatuses(Set<UserStatus> userStatuses) {
		this.userStatuses = userStatuses;
	}

}
